<html>
<head>
	<meta charset="UTF-8">
	<title>listusers</title>
</head>
<body>
<h2><a href="admin.php?c=user&m=reguser">用户注册</a></h2>
<center><h2>用户列表（共有<?php echo count($data['users']); ?>名用户）</h2></center>
<table border="1" align="center" width="80%">

<tr>
	<th>用户编号</th>
	<th>用户名</th>
	<th>性别</th>
	<th>生日</th>
	<th>爱好</th>
	<th>学历</th>
	<th>头像</th>
	<th>操作</th>
</tr>
<?php 
foreach ($data['users'] as $row) {
?>
<tr>
	<td><?php echo $row['uid'];?></td>
	<td><?php echo $row['uname'];?></td>
	<td>
	<?php  if($row['gender']==0)
				echo "男";
			   else
			   	echo "女";
	?>
	</td>
	<td><?php echo $row['birthdate'];?></td>
	<td><?php echo $row['hobby'];?></td>
	<td><?php 
			switch ($row['degree']) {
				case '1':
					echo "高中";
					break;
				case '2':
					echo "大学";
					break;
				case '3':
					echo "研究生";
					break;
				case '4':
					echo "博士生";
					break;
				
				default:
					echo "未选择学历";
					break;
			}
	    ?>
	</td>
	<td>
	<img src="./photos/<?php echo $row['pic'];?>" width="80" height="80" alt="头像" title="<?php echo $row['intro'];?>"></td>
	<td>
	<a href="admin.php?c=user&m=edituser&uid=<?php echo $row['uid'];?>">修改</a>
	<a href="admin.php?c=user&m=deluser&uid=<?php echo $row['uid'];?>">删除</a>
	</td>
</tr>

<?php
}
 ?>


</table>
<?php 
//var_dump($data['users']);
 ?>	
</body>
</html>